/*
 * Copyright 2006-2008 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.martinimix.service.payment.provider.cybersource.context;

import java.util.Map;

/**
 * Provides a request for CyberSource services.
 * 
 * @author Scott Rossillo
 *
 */
public interface CyberSourceServiceRequest {
	
	/**
	 * The request merchant reference code key name.
	 */
	public final static String MERCHANT_REFERENCE_CODE_KEY = "merchantReferenceCode";
	
	/**
	 * The request purchase totals currency key name.
	 */
	public final static String PURCHASE_TOTALS_CURRENCY_CODE_KEY = "purchaseTotalsCurrencyCode";
	
	/**
	 * Returns the value for the given key from this request.
	 * 
	 * @param key the key for the value to be returned
	 * 
	 * @return the value for the given <code>key</code> from this request
	 * if found; <code>null</code> otherwise
	 */
	public Object get(String key);
	
	/**
	 * Adds the given key and value pair to this request.
	 * 
	 * @param key the key to add; may not be <code>null</code>
	 * @param value the value for the given <code>key</code>
	 */
	public void put(String key, Object value);
	
	/**
	 * Adds all the values in the given map to this request.
	 * 
	 * @param m a <code>Map</code> containing key/values to add to this request
	 */
	public void putAll(Map m);

	/**
	 * Returns this request in map form as required by CyberSource.
	 * 
	 * @return this <code>CyberSourceServiceRequest</code> as a <code>Map</code>
	 */
	public Map toMap();
}
